begintalkscript;
variables;

begintalknode 1;
state = -1;
nextstate = -1;
question = "Guard";
text1 = "The guards in Alexandra are all wielding heavy weapons. They seem quite strong compared to guards elsewhere.";

begintalknode 2;
state = -1;
nextstate = -1;
question = "Archer";
text1 = "You take a look at the elegant moves of the bowmen and realize that they could anytime just pull out an arrow from the quiver and shoot a precise hit.";

begintalknode 3;
state = -1;
nextstate = 1;
question = "Commander";
text1 = "The commander of the town guard is huge. If he wouldn't be dressed up in official Empire battle armor he could be mistaken as an ogre.";
text2 = "_Hi_, he says with a low pitched voice. _I'm one of the commanders of the town guard. I prefer not to give you my name._";
text3 = "_But I can give you training._";
action = INTRO;
text5 = "_Oh hi! Want some more training?_";

begintalknode 4;
state = 1;
nextstate = -1;
question = "Yes, training is what I need!";
text1 = "You finish training.";
code = begin_shop_mode("Training with the Commander", "The commander is willing to teach you advanced use of the sword and the shield for reasonable prices.", 16, 2, -1);
break;

begintalknode 5;
state = 2;
nextstate = 3;
question = "Merchant";
text1 = "This tall woman has tied her hair behind. She looks like she has been hunting recently. _Hi! Would you like to buy some leather supplies?_";
text2 = "There is an old woman standing behind the counter. Something in her wares makes you sneeze. _Hello, hello! Welcome to my shop! Would you like to buy mushrooms?_";
text3 = "There is a short thin man behind the counter almost unseen behind the pile of books. _Hello! I sell the famous writings of David Silvercreek. Wanna buy?_";
text4 = "A short old woman is standing on a pedestal behind a tableful of lab equipment. _Hello, children. Do you want something strong magical?_";
code =
    clear_strings();
    if (character_talking_to() == 64) add_string(1);
    if (character_talking_to() == 65) add_string(2);
    if (character_talking_to() == 67) add_string(3);
    if (character_talking_to() == 66) add_string(4);
break;

begintalknode 6;
state = 3;
nextstate = -1;
question = "I'd like to see your wares.";
text1 = "You finish shopping.";
action = END_TALK;
code =
    if (character_talking_to() == 64) begin_shop_mode("Leather Supplies", "The strength of the wild animals that were used to create all this stuff is reflected in the quality of the wares.", 12, 4, 6);
    if (character_talking_to() == 65) begin_shop_mode("Mushrooms", "Because most of the mushrooms are fresh yet they make you sneeze again.", 1, 4, 6);
    if (character_talking_to() == 67) begin_shop_mode("Writings of David Silvercreek", "This is one of the propably many shops that distribrute the work of the well known author.", 13, 4, 6);
    if (character_talking_to() == 66) begin_shop_mode("Strong Magical Brew", "Among all the mortars and talismans there are small bottles with smelly liquid. They are for sale.", 10, 4, 6);
break;

begintalknode 7;
state = -1;
nextstate = 10;
condition = 1;
question = "Rezo";
text1 = "The library keeper seems to have a problem. He is dependent of doing labratory research. He has brought lab equipment here, the place where he is working at as a keeper!";
text2 = "It takes a while before he notices you. He says: _You can call me Rezo._";
action = INTRO;
text5 = "_Hey, haven't we met before?_";

begintalknode 8;
state = 10;
nextstate = 10;
condition = 1;
question = "Tell me about Alexandra.";
text1 = "_There's nothing I can tell you that you can't find out from elsewhere._";

begintalknode 9;
state = 10;
nextstate = 10;
question = "Tell me about what you are doing.";
condition = 1;
text1 = "He seems happy. _I am currently researching mushrooms. I have found out that Avernite toadstools resist acid better than the surface ones. Useful when making poison potion._";
text2 = "_Also, it is impossible to grow crypt shrooms on the surface. I have tried all kinds of fertilisation but none of them did anything to the situation._";
text3 = "_And, toadstools get a boosted opposite effect if they are dipped in a certain ester. This is important when making antidote. Look, like this!_ He puts a mushroom in a bowl with some liquid.";
text4 = "KA-BOOM !!!";
text5 = "_Argh, how could I be such clumsy._";

begintalknode 10;
state = 10;
nextstate = 11;
condition = 1;
question = "Can I get into the libraries?";
text1 = "_Sure._ But he does nothing.";

begintalknode 11;
state = 11;
nextstate = -1;
condition = 1;
question = "It means that you must open the gate for me!";
text1 = "_Yeah, yeah._ He lazily points at the gate with his rod. It opens.";
code = set_terrain(20, 37, 33);
break;

begintalknode 15;
state = -1;
nextstate = 15;
condition = 1;
question = "Wemba";
text1 = "The keeper of the guest givery seems to be a soldier. She is even dressed up in battle armor.";
text2 = "_Hello. You can call me Wemba. HmmmmYou don't look like a local. Perhaps you're a visitor and would like to stay here?_";
action = INTRO;
text5 = "_Oh, hi. Do you want something?_";
begintalknode 16;
state = 15;
nextstate = 16;
condition = 1;
question = "What are your services?";
text1 = "_If you're thirsty, you can have a cup of tea. 5 coins. You can also buy food._";
text2 = "_A night room and board is also available so if you're out here late you'll just have to pay 10 coins._";

begintalknode 17;
state = 16;
nextstate = 16;
condition = 1;
question = "A cup of tea, please.";
text1 = "_Okay._ She pours hot water and some black powder in a cup and gives it to you. You drink it.";
code = set_char_status(1000, 22, 20, 1, 0); 
break;

begintalknode 18;
state = 16;
nextstate = 16;
condition = 1;
question = "I'd like to buy rations.";
text1 = "You finish shopping.";
code = begin_shop_mode("Food", "There is not much to choose between in a small guest givery, but the food here looks delicious.", 18, 1, -1);
break;

begintalknode 19;
state = 16;
nextstate = -1;
condition = 1;
question = "A night room and board please.";
action = INN 15 19 53;
text1 = "_Okay, I hope you will have a good time._";
text3 = "_Oh no you don't. Hey! What did you think you'd pay with._";
text5 = "_I'm sorry, but we don't serve horses._";

begintalknode 20;
state = -1;
nextstate = 20;
question = "Devon";
condition = 1;
text1 = "You meet a high priest. He is quite young for being a high priest. However, he has the unique uniform and the ankh, so he is not faking.";
text2 = "_Hello, children! I am Father Devon, of the Brotherhood of Nelphis. Any favor I can do you?_";
action = INTRO;
text5 = "_Hello, children! I am glad to see you again._";

begintalknode 21;
state = 20;
nextstate = 21;
question = "What is this place?";
condition = 1;
text1 = "_This is the Temple of Nelphis. Here is the main altar and the meeting place of the brotherhood. We serve Nelphis and she'll serve us back._";

begintalknode 22;
state = 21;
nextstate = 21;
question = "Who is Nelphis? Is she a god?";
condition = 1;
text1 = "_No, she isn't. Or maybe she is. We don't know. She was once a mortal. However, her heroic deeds in the ancient past made her carma rise in divine heights._";
text2 = "_We don't know, because it is not important. This is not a god cult, anyway. We do not 'swear to ever only serve her as the only god'. That is not important._";

begintalknode 23;
state = 21;
nextstate = 22;
question = "What exactly does the brotherhood do?";
condition = 1;
text1 = "_We do what Nelphis did in the past. That is how we serve her. And she serves us by helping us in our quests._";

begintalknode 24;
state = 22;
nextstate = 23;
question = "What did she do?";
condition = 1;
text1 = "_She was a guardian of the forests. She was the protector of the animals. She worked for saving the nature._";
text2 = "_So that is what we do. We heal wounded animals, grow plants, and sometimes even terrorize hunter organizations._";
text3 = "_Don't get me wrong here. We scare all the animals away before the hunters arrive. We would never ever kill someone when he tries to get food in a quite natural way._";
text4 = "_Our job has become more difficult day by day. Sadly, no ents exist anymore._";

begintalknode 25;
state = 23;
nextstate = 23;
question = "What is it that is so difficult in your job?";
condition = 1;
text1 = "_Nowadays the Empire spends more and more time growing on their industries. They chop down woods, they hunt animals, in the past they threw all kinds of intelligent beings others than humans into Avernum._";
text2 = "_It was difficult enough already in the past. But it gets day by day more impossible, now that the Empire has got clues of our extince._";
text3 = "_We will propably be forced to end this movement._";

begintalknode 25;
state = 23;
nextstate = 23;
question = "What or who were the ents?";
condition = 1;
text1 = "_Yes, the mighty ents. They were like shepherds of the forests. Guardians of the trees. They all got killed in their last march against the Empire in ancient times._";
text3 = "_I sort of miss them, though I have never managed to see one myself, or even meet anyone who has._";
text2 = "_They were like giants made of wood. They looked like trees, but they had hands and feet. Our brotherhood was created a few years after their last march._";